home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / thor25_arexx.lha / GoldED / FigletV2.1.1.ged < prev    next >
Text File  |  1996-01-25  |  2KB  |  67 lines

  1. /* Figlet.ged.rexx by Manfred Matzinger
  2. ** $VER: Figlet.ged.rexx v2.00 (25.01.96)
  3. **
  4. ** Based on Figlet.ged by Troels Walsted Hansen
  5. **
  6. ** Modification: Works with Figlet V2.1.1
  7. **
  8. ** To find Figlet V2.1.1 please look at the Amiga Web Directory
  9. **        http://www.cucug.org/amiga.html
  10. **
  11. ** An ARexx script that asks you for a string and a figlet font,
  12. ** and then, using the figlet program, writes whatever string you
  13. ** entered, in the font you chose, into the editor.
  14. */
  15.  
  16. /* some user variables. edit to your hearts content */
  17.  
  18. figletprogpath = "Misc:Figlet/"
  19. figletfontpath = "Misc:Figlet/"
  20.  
  21. /* needs GoldED functions */
  22.  
  23. options results
  24.  
  25. if(substr(address(),1,6) ~= "GOLDED") then
  26. do
  27.         say "This script should only be started from inside GoldED."
  28.         exit 20
  29. end
  30. else gedport = address()
  31.  
  32. /* get string */
  33.  
  34. address(gedport)
  35. REQUEST BODY '"Enter some text:"' BUTTON '"_Ok|_Cancel"' TITLE '"Figlet.ged"' VAR figletstring STRING
  36. if(rc ~= 0) then exit
  37.  
  38. /* get fontname */
  39.  
  40. REQUEST TITLE '"Select figlet font:"' FILE PATH '"'figletfontpath'"' MASK '"#?.flf"' VAR figletfont
  41. if(rc ~= 0) then exit
  42.  
  43. lastchar = right(figletfont,3)
  44. if(lastchar ~= "flf" | figletfont = "") then exit
  45.  
  46. /* run figlet */
  47.  
  48. call open(ofh, "T:figlet.fse.temp.file1", W)
  49.         call writeln(ofh, figletstring)
  50. call close(ofh)
  51.  
  52. QUERY RIGHT VAR columnsnumber
  53.  
  54. address command
  55. figletprogpath || 'figlet <T:figlet.fse.temp.file1 >T:figlet.fse.temp.file2 -f ' || delstr(figletfont, lastpos(".",figletfont)) || ' -c -w ' || columnsnumber
  56.  
  57. address(gedport)
  58. OPEN NAME '"T:figlet.fse.temp.file2"' FAST INSERT
  59.  
  60. /* cleanup and exit */
  61.  
  62. if(exists("T:figlet.fse.temp.file1")) then address command 'delete >nil: "T:figlet.fse.temp.file1"'
  63. if(exists("T:figlet.fse.temp.file2")) then address command 'delete >nil: "T:figlet.fse.temp.file2"'
  64. exit
  65.  
  66.  
  67.